From: Lars Ingebrigtsen Date: Sat, 22 Jan 2022 12:14:36 +0000 (+0100) Subject: Fix HTML target marking in shr X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~3303 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a0e6e67ac16b1d73e50b2af014a8319e2afe76a2;p=emacs.git Fix HTML target marking in shr * lisp/net/shr.el (shr-descend): Use a marker (because we may be altering the text later for indentation), and mark the start, not the end of the tag (bug#53409). (shr-tag-a): Ditto. --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index ff14acfda70..6e0af06bed1 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -630,7 +630,7 @@ size, and full-buffer size." (t (shr-generic dom))) (when-let ((id (dom-attr dom 'id))) - (push (cons id (point)) shr--link-targets)) + (push (cons id (set-marker (make-marker) start)) shr--link-targets)) ;; If style is set, then this node has set the color. (when style (shr-colorize-region @@ -1465,7 +1465,7 @@ ones, in case fg and bg are nil." (shr-generic dom) (when-let* ((id (and (not (dom-attr dom 'id)) ; Handled by `shr-descend'. (dom-attr dom 'name)))) ; Obsolete since HTML5. - (push (cons id (point)) shr--link-targets)) + (push (cons id (set-marker (make-marker) start)) shr--link-targets)) (when url (shr-urlify (or shr-start start) (shr-expand-url url) title) ;; Check whether the URL is suspicious.